package com.atguigu.eduucenter.service;

import com.atguigu.eduucenter.entity.UcenterMember;
import com.atguigu.eduucenter.entity.vo.RegisterUserVo;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 会员表 服务类
 * </p>
 *
 * @author Y丶HS练习谷粒商城
 * @since 2022-10-06
 */
public interface UcenterMemberService extends IService<UcenterMember> {

    /**
     * 用户登录
     * @param entity
     * @return
     */
    String login(UcenterMember entity);
    /**
     * 用户注册
     * @param entity
     * @return
     */
    void register(RegisterUserVo entity);

    /**
     * 判断手机号是否存在
     * @param mobile
     * @return
     */
    Boolean isExist(String mobile);

    /**
     * 根据token获取用户信息
     * @param request
     * @return
     */
    UcenterMember getUserInfo(HttpServletRequest request);

    /**
     * 退出登录
     * @param request
     */
    void logout(HttpServletRequest request);

    /**
     * 确定是否存在微信登录用户
     * @param openid
     * @return
     */
    UcenterMember getByOpenid(String openid);

    /**
     *
     * @param ucenterMember 用户对象
     * @return token
     */
    String weiXinLogin(UcenterMember ucenterMember);

    /**
     * 查询某一天的注册人数
     * @param day
     * @return
     */
    Integer countRegister(String day);
}
